package com.tutu.service;

import com.tutu.entity.vo.BaseVo;
import com.tutu.entity.vo.CodeDictVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * CodeDictService
 * Created by 奕恒 on 2022/12/29 21:50.
 */
public interface CodeDictService {

    // 查询（分页）
    Map<String, Object> pageByParams(String type, String keyWord, Integer page, Integer limit);

    // 查询详情
    Map<String, Object> getInfoById(Integer id);

    // 添加 or 修改
    Map<String, Object> saveInfo(HttpServletRequest request, Integer id, String type, String code, String name, String unit);

    // 删除
    Map<String, Object> deleteById(HttpServletRequest request, Integer id);

    // 批量删除
    Map<String, Object> batchDel(HttpServletRequest request, String ids);

    Map<String, Object> batchUpdate(HttpServletRequest request, String type, String codeDictCodes, String unit);

    // 查询所有类型信息
    List<BaseVo> findTypeList();

    // 根据设备MN号和类型获取对应的设备参数列表
    List<CodeDictVo> findDataList(String deviceCode, Integer type);

    // 同步字典信息
    Map<String, Object> syncData(HttpServletRequest request);

    // 加载缓存数据
    void loadCacheData();
}
